﻿using System;
using System.IO;
using System.Xml;
using SPSource.Lists;
using SPSource.Field;

namespace SPSource
{
    public class SPSourceFileProcessor
    {
        private ListManager _listManager;
        private ContentTypeManager _contentTypeManagerManager;
        private FieldManager _fieldManager;
        private ModuleManager _moduleManager;

        public SPSourceFileProcessor(SPSourceFileInfo spSourceFileInfo)
        {
            _listManager = new ListManager(spSourceFileInfo);
            _contentTypeManagerManager = new ContentTypeManager(spSourceFileInfo);
            _fieldManager = new FieldManager(spSourceFileInfo);
            _moduleManager = new ModuleManager(spSourceFileInfo);
        }

        public void ListTemplate(XmlNode listTemplate)
        {
            _listManager.GetList(listTemplate);
        }

        public void ContentType(XmlNode contentType)
        {
            _contentTypeManagerManager.GetContentType(contentType);
        }

        public void Field(XmlNode field)
        {
            _fieldManager.GetField(field);
        }

        public void Module(XmlNode module)
        {
            _moduleManager.GetFiles(module);
        }
    }
}